import './editor.css';

export class Editor extends HTMLElement {
    constructor() {
        super();
        this.#fontFamily = localStorage['font-family'] || 'Arial';
        this.#fontSize = localStorage['font-size'] || '16pt';
        this.#fontStyle = localStorage['font-style'] || 'normal';
        this.#fontWeight = localStorage['font-weight'] || 'normal';
        this.#init();
    }
    #init() {
      this.innerHTML= this.#html;
      this.$ = this.querySelector;
      this.#$editor = this.$('.ediText');

      this.#$editor.style['font-family'] = this.#fontFamily;
      this.#$editor.style['font-size'] = this.#fontSize;
      this.#$editor.style['font-weight'] = this.#fontWeight;
      this.#$editor.style['font-style'] = this.#fontStyle;

     }
   
    #$editor = null;
    #fontFamily = '';
    #fontStyle='';
    #fontSize='';
    #fontWeight='';
    #html = ''
        +'<div class="notepad-editor">'
          +'<textarea class="ediText" autofocus spellcheck="false" auto-size="none" wrap="off" style="overflow-x: scroll; font-family: Arial; font-size: 16pt; font-weight: normal; font-style: normal;"></textarea>'
        +'</div>';

}
